<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>订单列表</title>
    <!-- 引入 Bootstrap 样式文件 -->
    <link rel="stylesheet" href="https://cdn.bootcdn.net/ajax/libs/twitter-bootstrap/3.4.1/css/bootstrap.min.css">
</head>

<body>
<ul>
    <li><a th:href="@{/user}">user</a></li>
</ul>
<div class="container">
    <h1>订单列表</h1>

    <div class="row">
        <div class="col-md-12 text-right">
            <!-- 新增按钮 -->
            <a th:href="@{/addorder}" class="btn btn-primary btn-sm">新增</a>
        </div>
    </div>

    <table class="table table-striped">
        <thead>
        <tr>
            <th>ID</th>
            <th>描述</th>
            <th>金额</th>
            <th>状态</th>
            <th>操作</th>
        </tr>
        </thead>
        <tbody>
        <tr th:each="data : ${dataList}">
            <td th:text="${data.id}"></td>
            <td th:text="${data.name}"></td>
            <td th:text="${data.amount}"></td>
            <td th:text="${data.state}"></td>
            <td>
                <!-- 编辑按钮 -->
<!--                <a th:href="@{/edit/{id}(id=${data.id})}"  class="btn btn-info btn-sm">编辑</a>-->
                <!-- 删除按钮 -->
                <a th:href="@{/delete/{id}(id=${data.id})}" class="btn btn-danger">删除</a>
            </td>
        </tr>
        </tbody>
    </table>

</div>

<!-- 引入 Bootstrap JavaScript 文件 -->
<script src="https://cdn.bootcdn.net/ajax/libs/twitter-bootstrap/3.4.1/js/bootstrap.min.js"></script>

</body>
</html>